import Vue from "vue";
import Vuex from "vuex";

Vue.use(Vuex);

const store = new Vuex.Store({
  state: {
    listReachBottom: false, // 列表滑动是否到达底部，用于分页
    listLoad: "", // 记录列表当前加载的是什么内容
    selectedFolderId: "", // 选中的文件夹id
    listOperate: "", // 当前列表项的操作
    listOperateData: {}, // 当前列表项操作传递的数据    
  },
  mutations: {
    setListOperate(state, value) {
      state.listOperate = value;
    },
    setListOperateData(state, value) {
      state.listOperateData = value;
    },
    setListReachBottom(state, value) {
      state.listReachBottom = value;
    },
    setListLoad(state, value) {
      state.listLoad = value;
    },
    setSelectedFolderId(state, value) {
      state.selectedFolderId = value;
    },
  },
});

export default store;
